//
//  PayTicketDescTableCell.m
//  didacar
//
//  Created by 度周末网络-王腾 on 15/12/23.
//  Copyright © 2015年 dzmmac. All rights reserved.
//

#import "PayTicketDescTableCell.h"
#import "UIScreen+Frame.h"

@implementation PayTicketDescTableCell

- (void)awakeFromNib {
    [self.contentView addSubview:[CommoneTools createLineWithFrame:CGRectMake(0, 44, [UIScreen width], 0.45)]];
    [self.contentView addSubview:[CommoneTools createLineWithFrame:CGRectMake(0, 88, [UIScreen width], 0.45)]];
    
    UIView *line1 = [CommoneTools createLineWithFrame:CGRectMake(5, 1.7, 70, 0.45)];
    line1.backgroundColor = UI_RGBA(236, 138, 12, 1);
    
    UIView *line2 = [CommoneTools createLineWithFrame:CGRectMake(5, 28, 70, 0.45)];
    line2.backgroundColor = UI_RGBA(236, 138, 12, 1);
    [self.countBgView insertSubview:line1 atIndex:0];
    [self.countBgView insertSubview:line2 atIndex:0];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
}

- (IBAction)addBtnAction:(UIButton *)sender {
    [self.delegate addBtnAction:sender];
}

- (IBAction)mintueBtnAction:(UIButton *)sender {
    [self.delegate mintueBtnAction:sender];
}

- (IBAction)selectedSaleTicketBtnAction:(UIButton *)sender {
    [self.delegate selectedSaleTicketBtnAction:sender];
}

-(void)setCellPayTicketStyle:(PayTicketStyle)payTicketStyle dayCount:(NSString *)dayCount{
    switch (payTicketStyle) {
        case PayTicket_ThroughBus:
        {
            self.countBgView.hidden = NO;
            self.monthLabel.hidden = YES;
        }
            break;
        case PayTicket_Month:{
            self.countBgView.hidden = YES;
            self.monthLabel.hidden  = NO;
            self.monthLabel.text = [NSString stringWithFormat:@"(月票)%@天",dayCount];
            break;
        }
        case PayTicket_Day:{
            self.countBgView.hidden = YES;
            self.monthLabel.hidden  = NO;
            self.monthLabel.text = [NSString stringWithFormat:@"(日票)%@天",dayCount];
        }
        default:
            break;
    }
}
@end
